home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / mac / files / t_sys5 / nosdoc.txt < prev    next >
Internet Message Format  |  1996-06-25  |  23KB

  1. Date: Tue, 22 Nov 88 00:35:09 EST
  2. From: karn@ka9q.bellcore.com (Phil Karn)
  3. To: tcp-group@ucsd.edu
  4. Subject: nos.arc on flash.bellcore.com
  5.  
  6. I'm uploading the file nos.arc to flash.bellcore.com under the /pub/ka9q
  7. directory. This contains the current source of the new version I've been
  8. working on. Although it is *NOT* yet complete, I thought I should make it
  9. available so people can see how it's shaping up.
  10.  
  11. Go ahead and give it a try on the Internet. I have NOT yet finished the
  12. implementation of AX.25 sockets, so don't bug me about that part yet.
  13.  
  14. I know, I know, there's no documentation yet. The main thing you need to know
  15. is that \hosts.net has been replaced with \domain.txt, and the format is
  16. that of a domain server database, not UNIX /etc/hosts.
  17.  
  18. Phil
  19.  
  20. Unfortunately, I just haven't had the time to update the documentation
  21. for NOS. Actually, the user interface isn't that much different; the main
  22. difference is the use of a domain resolver. As part of this work I
  23. got rid of hosts.net in favor of a local domain cache called domain.txt.
  24.  
  25. A word of warning about the domain stuff in NOS: the domain.txt file is
  26. intended only as a local CACHE for the resolver. I have not yet done a
  27. domain SERVER, so the content of domain.txt is not necessarily the same
  28. as you would put in a server database.
  29.  
  30. This particular version tries to grab 200K from the system at startup time
  31. for the heap; if less is available, it'll get whatever it can. If you
  32. want to use more, modify the call to grabcore() in pc.c. Eventually this
  33. will probably be a easily configurable value.
  34.  
  35. 1. I've made the final switch to Turbo. You need Turbo C 2.0 Professional to
  36. compile and assemble this package from scratch.
  37.  
  38. 2. The command line now accepts several arguments that are best illustrated
  39. by example:
  40.  
  41.     net /m200 /s40 /d\ /autoexec.net
  42.  
  43. In this case, net is told to grab 200K of memory from MS-DOS for the heap,
  44. to allow a maximum of 40 active sockets, and to make the directory prefix
  45. for all files (configuration, domain.txt, mail spool files, etc) the root.
  46. These particular values all happen to be the defaults for their
  47. corresponding parameters, so of course you'd get the same effect by just
  48. typing "net".
  49.  
  50. I decided that command line parameters were a better way to go than
  51. environment variables. The latter don't necessarily exist on systems other
  52. than MS-DOS and UNIX.  You can always create a batch (shell script) file
  53. to invoke net with the parameters you want.
  54.  
  55. If you call net with the -d option, you can specify the parent
  56. directory of all the various files used by net.
  57.  
  58. Interesting. Well, one thing you might try is giving NOS less memory than
  59. the default, which is 200K for the heap. On my 640K system with no major
  60. TSRs running (just MS-DOS, COMMAND.COM and TRW PC-2000 packet driver) this
  61. leaves about 155K unused. (I also have a disk cache and ram disk, but they
  62. all run in extended memory). Depending on what else you might have loaded,
  63. the problem might well be as simple as running out of memory, e.g., if your
  64. driver tries to request memory from DOS when it is all taken but doesn't
  65. bother checking (or behaving rationally) when this happens.
  66.  
  67. To specify less memory, invoke NOS like this:
  68.  
  69. net /m100
  70.  
  71. That would cause it to grab only 100K.
  72.  
  73. NOS does not deliberately "barf" if it requests more memory space than was
  74. available. It will simply use whatever is available. The only problem this
  75. creates is when you try to shell out to run a subcommand; there won't be
  76. any memory left to run command.com.
  77.  
  78. 2. As you can probably tell from the foregoing example, NET is now large
  79. model by default. The code will still compile and run under small model
  80. if you want. In large model you can use as much memory as the system has
  81. available for buffering, but the downside of this is that there may be none
  82. left for other activities, e.g., running under a multitasker or shelling
  83. to a subprogram.  Hence the option of specifying how much memory should
  84. be used. You can now run many more sessions, run much larger windows, etc,
  85. and it all works!
  86.  
  87. 2. The domain receiver task is now started immediately after the very first
  88. "domain addserver" command is executed. This allows subsequent lines in the
  89. autoexec.net file to refer to domain names that aren't yet in domain.txt --
  90. IF sufficient routing entries are already in place to reach the domain
  91. server.  Formerly, the use in autoexec.net of any domain name that wasn't
  92. already in domain.txt caused net to hang at startup.  Note, however, that
  93. domain.txt still needs a few "seed" entries if you use domain names for
  94. the "ip address" and "domain addserver" commands, or for "route add"
  95. commands necessary to reach the domain server.
  96.  
  97. The ip address must be set before the first "domain addserver" command.
  98.  
  99. 1. A finger server has been added. It works similarly to the pre-NOS finger
  100. server by KA7AXD *except* that the files under /finger do NOT have ".txt"
  101. appended to them. If you finger "foo@machine.name", finger will send back
  102. the contents of "/finger/foo".
  103.  
  104. 2. I finally got tired of the schizophrenic MS-DOS use of either backslash
  105. (\) or forward slash (/) as the path separator in file names. The code now
  106. deals strictly with forward slashes just as though it's running under UNIX;
  107. MS-DOS system calls that return pathnames now have any backslashes in
  108. their return values immediately converted to forward slashes for consistency.
  109.  
  110. This requires ONE IMPORTANT CHANGE -- you must edit your /ftpusers file to
  111. change all instances of backslash in the allowable prefix field to forward
  112. slash, or you will not be able to access any files. The symptoms of not
  113. doing this are that you will be allowed to log in via FTP, but every
  114. operation you try will be rejected with a "permission denied" message -- even
  115. if you are supposed to have full access to the system.
  116.  
  117. 3. The session summary command ("session" without arguments) now shows any
  118. active data connections that are associated with FTP sessions.
  119.  
  120. 3. Added the "delete" and "rename" top-level commands.
  121.  
  122. Lately I've been receiving an increasing number of messages asking
  123. questions about the UNIX ports of my code, particularly Xenix and AT&T
  124. Unix System V (e.g., Microport).
  125.  
  126. I need to point out a few things:
  127.  
  128. 1. I did not do these ports. In fact, all of my TCP/IP development work
  129. is done on an AT clone running MS-DOS 3.3. That is the ONLY version of
  130. NET about which I can answer questions.
  131.  
  132. 2. As a matter of personal principle, I avoid all AT&T-based UNIX
  133. systems.  All of the UNIX systems I use run Berkeley or Berkeley-derived
  134. code (e.g., SunOS, Ultrix). Since all BSD-based UNIX systems already
  135. have full TCP/IP support, there is little reason to run my code on those
  136. systems.
  137.  
  138. 3. Bob Hoffman, hoffman@vax.cs.pittsburgh.edu, has graciously agreed to
  139. act as coordinator of those working with UNIX ports of my code. Please
  140. direct any questions about these versions to him, not to me.
  141.  
  142. 1. The "remote" server and client are completely reworked. The "reset"
  143. and "exit" functions no longer depend on the secrecy of the control port
  144. number, but use a password text string instead. (Not that this makes
  145. things any more secure against someone merely watching the channel, of
  146. course. Someday this will be replaced with a cryptographic
  147. authenticator.)
  148.  
  149. I did this because I just added a "remote kick" command and I wanted to
  150. make it available to everyone without also making the more disruptive
  151. "exit" and "reset" functions also freely available. I therefore
  152. recommend that people use the default port number (0x1234) whenever
  153. possible.
  154.  
  155. As before, there are no explicit acknowledgements to any of the "remote"
  156. commands.
  157.  
  158. Here are a few sample commands:
  159.  
  160. net> remote pc.ka9q.ampr.org kick
  161.  
  162.     Tell pc.ka9q.ampr.org to kick all TCP connections it has with me.
  163.     If there aren't any, do nothing.
  164.  
  165. net> remote -p 555 pc.ka9q.ampr.org kick
  166.  
  167.     As above, but send the command to UDP port 555 on the remote system.
  168.     (You won't have to use this if everybody uses the default port
  169.     when starting the remote server.)
  170.  
  171. net> remote -a ka9q.bellcore.com pc.ka9q.ampr.org kick
  172.  
  173.     Tell pc.ka9q.ampr.org to kick all TCP connections it may have with
  174.     ka9q.bellcore.com.
  175.  
  176. net> remote -k key pc.ka9q.ampr.org exit
  177.  
  178.     Tell the copy of net.exe on pc.ka9q.ampr.org to exit. (If the
  179.     specified key is incorrect, the remote system will log that
  180.     fact and take no other action, giving you half a chance to detect
  181.     nasty people before they do actual damage.) "reset" may be
  182.     substituted for "exit"; this causes a cold reboot of the remote
  183.     system (MS-DOS only).
  184.  
  185. net> remote -s mykey
  186.  
  187.     Set the key for the local system's "remote" server. (This command
  188.     does not generate any network packets.) NB: Until a key
  189.     is set for the local system, it will refuse ALL remote requests
  190.     except those for TCP kicks. I.e., you can allow remote kicks
  191.     while disallowing remote resets and exits altogether by not
  192.     setting a key.
  193.  
  194. The protocol formats for the new "remote" command are reasonably
  195. backward compatible with the old. The commands are sent in UDP
  196. datagrams, as before, with the first byte of the data field containing
  197. the command (1 == reset, 2 == exit, 3 == kick). In the case of reset or
  198. exit, the variable length key must immediately follow the command byte.
  199. For the kick command, an optional 4-byte target IP address to kick
  200. follows the command byte; there is no key field. If the target IP
  201. address is missing, the system will default to kicking the source
  202. address in the UDP command packet.
  203.  
  204. This version includes the NET/ROM layer 3 and 4 protocols as integrated
  205. into NOS by SM0RGV. I had to fix a few ANSI function prototypes and delint
  206. a few other places, but I've adopted Anders' code pretty much as is. It
  207. seems to work, although I did notice one occasion that the NET/ROM routing
  208. table got garbled. I would like reports from others on how well this code
  209. works before we put it into wide circulation.
  210.  
  211. I just fixed a typo in nr3.c that kept IP-over-NET/ROM from working,
  212. and I also added a remote kick feature to SMTP. This latter feature
  213. is coupled with the remote tcp kick server I added the other week,
  214. in that now when you kick a remote station it will not only do a
  215. TCP kick on any existing TCP connections it may have with you, but it
  216. will also run through the SMTP queue and start up a session for anything
  217. that's waiting for you.
  218.  
  219. This feature should be very useful to those who want to run mail gateways
  220. with manually dialed SLIP links (with Tomcat being the prime example).
  221. All you'll have to do is dial the connection to Tom's machine and send
  222. it the remote kick command (which is encapsulated in a UDP datagram).
  223. His system will then immediately send you any mail it has waiting for you.
  224.  
  225. I've updated the version of nos on flash. I incorporated some bug fixes to
  226. the NET/ROM socket interface code from Anders, and I added a new command to
  227. the ip layer: "ip rtimer". This allows you to set the IP level reassembly
  228. timeout interval. This is the length of time that IP will keep the fragments
  229. of an incomplete datagram around while waiting for additional fragments to
  230. arrive; the reassembly timer is restarted each time a new fragment arrives.
  231.  
  232. The timeout value was formerly hard-coded at 30 seconds. This is now the
  233. default for the new command, so if you do nothing the system will continue
  234. to behave exactly as before. NB: the value for rtimer, as with other timer
  235. values, is in MILLISECONDS.
  236.  
  237. I added this in response to some observations by WB0MPQ that indicated that
  238. IP reassembly timeouts were occurring before subsequent fragments could be
  239. delivered successfully over a NET/ROM network (yes, it's really that slow).
  240. But be careful: if you set the timeout too long and you get a lot of
  241. fragmentary datagrams that never complete, you'll tie up a lot of memory.
  242.  
  243. I'm uploading the version of NOS on flash.bellcore.com. This version
  244. supports RIP, the interior routing protocol made popular by Berkeley UNIX.
  245. To enable the reception of RIP broadcasts, merely say
  246.  
  247. start rip
  248.  
  249. If you're not acting as a gateway to anyone, this is all you need do -- your
  250. system will begin to passively monitor its interfaces for broadcast routing
  251. packets and it will automatically add routes to the routing table. It may
  252. take up to 30 seconds on an ethernet for the table to be built (this assumes
  253. a broadcast rate of 30 seconds, which is standard on Ethernet). If you want
  254. to get started faster, you can give an optional IP address to the command:
  255.  
  256. start rip [128.96.160.0]
  257.  
  258. This broadcasts a RIP "request" packet on the local subnet, which triggers
  259. each gateway within earshot to send you its routing tables. (This requires
  260. knowledge of the local IP broadcast address, plus an ARP entry for same.
  261. Read on to find out about both of these things.)
  262.  
  263. If you are also acting as a gateway, then you'll want to enable the transmit
  264. routines. First add ARP entries that map the local broadcast address for
  265. each of your networks to the correct hardware address. For example, the IP
  266. broadcast address on my shack Ethernet is 128.96.160.0, so I include the
  267. line
  268.  
  269. arp add [128.96.160.0] ethernet ff:ff:ff:ff:ff:ff
  270.  
  271. in my /autoexec.net file. Then I enable the broadcasting of routing info
  272. with the line
  273.  
  274. rip add [128.96.160.0] ethernet 30 6
  275.  
  276. This means "broadcast your routing tables every 30 seconds on the interface
  277. named 'ethernet', using IP destination address 128.96.160.0. Generate
  278. triggered updates as necessary, and use the split horizon method."
  279.  
  280. On a packet radio channel, I might use the following lines:
  281.  
  282. arp add [44.64.0.0] com1 qst-0
  283. rip add [44.64.0.0] com1 600 7
  284.  
  285. The last parameter in the "rip add" command is the flag parameter. It is the
  286. sum of the following possible flag values:
  287.  
  288. 1 - Include a host-specific route to yourself in each update. (Not needed
  289.     if you're already advertising a route to the network you're on.)
  290. 2 - Use split horizon updating; that is, omit all routing entries that
  291.     point to the interface being used for the broadcast. (This reduces the
  292.     chances of routing loops forming).
  293. 4 - Generate triggered updates as necessary on this interface, i.e.,
  294.     whenever a metric changes in the routing table, immediately generate
  295.     a broadcast on this interface with the changed entries. If split horizon
  296.     (bit 2) is also set, use "poisoned reverse", i.e., for any routing
  297.     table entries that point to this interface, include them with an
  298.     infinite metric (RIP defines 16 to be infinity) instead of leaving them
  299.     out as happens during a normal routing broadcast when split horizon
  300.     is set.  Triggered updates helps spread the word faster when links
  301.     fail, reducing the chances of a temporary loop forming.
  302.  
  303. For Ethernet, I recommend a flag value of 6 (triggered updates and split
  304. horizon). On SLIP links, use 6 or 7, depending on whether you need to
  305. emit a host-specific route to yourself.  On a packet radio channel where
  306. everyone is not fully connected (the usual case), use 7 and DON'T advertise
  307. any routes to the subnet unless you can reach everyone in that subnet.
  308. (A packet radio channel is best modeled as a collection of point-to-point
  309. links since it rarely fits the model of a fully interconnected subnet
  310. like Ethernet.) Note that you don't have to broadcast your routes; you
  311. can direct them to a specific set of stations by using their names or
  312. addresses in the "rip add" command. You can have any number of such
  313. commands per interface, with the only limit being channel traffic overhead.
  314.  
  315. An experimental parameter is available to control something I call "route
  316. merging". If you say "rip merge on", then an incoming route that is more
  317. specific than one you already have in your table is ignored if they both
  318. point to the same gateway. For example, if you already have a default route
  319. that points to gateway "foobar", then any route that arrives from gateway
  320. foobar will be ignored because to put it in the table would not cause any
  321. change in the routing of packets -- they'd still go to foobar anyway.
  322. Properly used, this should save a lot of routing table space.
  323.  
  324. You can trace the automatic routing messages and controls by the "rip trace"
  325. command; it takes a numeric parameter. "rip trace 0" disables tracing, "rip
  326. trace 1" generates messages only when routes change, and "rip trace 2" shows
  327. you everything, even when things are stable.
  328.  
  329. If you want to ignore routing broadcasts from a certain gateway (e.g.,
  330. because it can't hear you), say
  331.  
  332. rip refuse hostname
  333.  
  334. where 'hostname' is the domain name or [ip address] of the offending
  335. gateway.  To reverse this, just say
  336.  
  337. rip accept hostname
  338.  
  339. This manual filtering will probably do until I'm able to devise some sort of
  340. link connectivity algorithm and protocol that can analyze the quality of the
  341. path between your station and each of your neighbors so routing packets can
  342. be filtered automatically. I have an idea of how to do this -- by
  343. broadcasting periodic status packets containing received and transmitted
  344. packet count statistics and using such packets to determine how well you're
  345. being heard.
  346.  
  347. Ooops, I think I made a minor error in my discussion of RIP over radio.  The
  348. flag setting for RIP broadcasts over a radio channel should probably be 5,
  349. not 7. You don't want to use split horizon over a radio subnetwork unless it
  350. is internally fully connected, since there may well be relay routes that
  351. enter and leave an intermediate station by the same interface. Split horizon
  352. would suppress such routes, which would preclude same-channel relay hops.
  353.  
  354. I've updated the NOS code on flash. I've been doing a lot of work on the
  355. RIP code to fix bugs and make things more stable. I changed the command
  356. syntax for a couple of the rip commands; look at the help messages or
  357. read the source for details until I can document things further.
  358.  
  359. Note! This version REQUIRES that you set the default local IP address (i.e.,
  360. issue the "ip addr" command) BEFORE you attach any interfaces. So edit your
  361. autoexec.net file appropriately.
  362.  
  363. The reason for this requirement is the major change in this version: each
  364. interface can now have its own IP address. An interface's IP address can be
  365. specified in the attach command, but if it is omitted the IP address given
  366. earlier in the "ip address" command will be used by default. (Hence the
  367. requirement given above. I considered doing away with the "ip address"
  368. command altogether and making the ip address argument on each attach command
  369. required, but this would have been a more disruptive change.)
  370.  
  371. This architectural change brings the NET package into line with standard
  372. Internet practice. This is mainly for the benefit of those who use NET as a
  373. router between Ethernets in a regular Internet environment, where the other
  374. hosts and routers lack NET's extensions to the standard Internet routing and
  375. subnetting facilities.  Although it was possible to make the earlier code
  376. work in such situations through a combination of proxy arp and static
  377. routes, it was a little unclean. With this version, the machine can be set
  378. up to act just like a conventional Internet router and multi-homed host.
  379. I.e., if you have NET running with several interfaces, each with its own
  380. unique IP address, the system will accept packets addressed to any of its
  381. interfaces' addresses. When the system originates packets, the local address
  382. appropriate for the sending interface will be used, all in accordance with
  383. standard Internet practice. Note that when you do a "tcp stat" the local IP
  384. addresses for connections in LISTEN state are 0.0.0.0; this is normal. The
  385. appropriate IP address is used when the connection is actually opened.  The
  386. BSD constant "INADDR_ANY" is provided in a header file, and it can be used
  387. just as it is in BSD when binding local socket addresses in an application.
  388.  
  389. Note that you are definitely NOT required to have a unique IP address for
  390. each interface. If you specify the same IP address for each interface (or
  391. allow each interface to use the global default set with the "ip address"
  392. command), then the package behaves just as it did before.  Therefore this
  393. change is largely irrelevant to most AMPRNET users. It is also irrelevant
  394. whose NET configurations have only a single interface (i.e., all end-user
  395. systems that don't operate as gateways).
  396.  
  397. I've added a new command, "iface", that lists the interfaces on the system
  398. along with their parameters (e.g., IP address, send and receive packet
  399. counts, etc.)  There's also a "domain listservers" command that displays
  400. the list of domain servers along with various statistics measured for each.
  401.  
  402. Subject: lost first characters
  403.  
  404. I haven't investigated Tom's specific problem, but I've seen similar
  405. things in the past and it's almost always been due to null characters
  406. inbedded in the stream being sent to the terminal. The ANSI.SYS and
  407. NANSI.SYS drivers both display a null (0) character exactly as though
  408. it were a space, and this I consider a bug. Every other terminal I've
  409. ever seen treats null as a no-op.  One of these days I'll dig into
  410. the NANSI.SYS source and fix it.
  411.  
  412. 1. KY3B's port of PE1CHL's generic 8530 driver. Ken did all the work of
  413. porting Rob's driver to NOS. I took his code, reformatted and delinted it a
  414. bit and added ANSI-style function prototypes, but I have not actually tested
  415. it.  Those of you using DRSI cards with slow speed modems, please give this
  416. driver a try and let us know if it works. There's a flag in config.h for
  417. configuring out this code if you don't need it and want to save the space.
  418.  
  419. 2. I added an option in config.h for turning off the mailbox code.  When the
  420. mailbox has been configured out, the following commands are removed:
  421.  
  422. mbox
  423. start telnet/netrom/ax25
  424. stop telnet/netrom/ax25
  425.  
  426. The "mbox y" command is gone. It didn't seem to make sense to keep it around
  427. given the presence of a separate "ttylink" server that goes straight to the
  428. console. So whenever the mailbox is configured into the system the telnet,
  429. netrom and ax25 servers all get the mailbox automatically. One less thing
  430. you have to remember to put in your autoexec.net files...
  431.  
  432. I'm currently updating the NOS on flash. This incorporates the latest mbox
  433. and netrom patches by Anders, the latest DRSI driver from Stu, and the
  434. vector-saving fix to ec.c suggested by Ron Henderson.  The only change I
  435. made myself was to add an #ifdef MAILBOX in fingerd.c around a reference
  436. to the mailbox code.
  437.  
  438.